{
  "$schema" : "http://json-schema.org/draft/2019-09/schema#",
  "title" : "Load Daemon Response",
  "type" : "object",
  "additionalProperties" : false,
  "properties" : {
    "interfaceCategory" : {
      "type" : "string",
      "enum" : [ "Payments" ],
      "description" : "CMP categorisation of the job associated with this file "
    },
    "interfaceType" : {
      "type" : "string",
      "enum" : [ "Recurring Card Payments", "Recurring Bank Payments" ],
      "description" : "Sub-categorisation of the job"
    },
    "version" : {
      "type" : "number",
      "minimum" : 0.0,
      "maximum" : 99.99,
      "description" : "The current version of the generic extract file. This must match the corresponding outbound file."
    },
    "transformDateTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Indicates when a third-party file was transformed into the format required by CMP"
    },
    "transmitDateTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Indicates when a file was sent to or received from a third-party system"
    },
    "externalFileName" : {
      "type" : "string",
      "pattern" : "^([a-zA-Z0-9._-])+$",
      "maxLength" : 100,
      "description" : "Third party file name"
    },
    "details" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/LoadDaemonResponseDetail"
      }
    }
  },
  "required" : [ "interfaceCategory", "interfaceType", "version", "externalFileName" ],
  "definitions" : {
    "LoadDaemonResponseDetail" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "detailSequence" : {
          "type" : "integer",
          "description" : "Unique identifier of the detail record within the file"
        },
        "hierarchyEntity" : {
          "$ref" : "#/definitions/HierarchyEntity",
          "description" : "This hierarchy entity the payment/refund relates to"
        },
        "transactionType" : {
          "type" : "string",
          "enum" : [ "PAYMENT", "REFUND" ],
          "description" : "Indicates if payment or refund"
        },
        "transactionId" : {
          "type" : "integer",
          "minimum" : 1,
          "maximum" : 99999999,
          "description" : "Unique identifier of the payment/refund transaction.  This should be included in requests that are sent to third-party  systems"
        },
        "externalReference" : {
          "type" : "string",
          "maxLength" : 50,
          "description" : "Allow for an external reference to be stored in CMP, for example a third party identifier"
        },
        "transactionCode" : {
          "type" : "string",
          "maxLength" : 20,
          "description" : "Populated if the transaction has not completed normally. Must be a valid CMP response code that is configured to control how the transaction failure is handled"
        },
        "transactionSummary" : {
          "type" : "string",
          "maxLength" : 50,
          "description" : "Short description of the transaction e.g. may contain an external error description"
        },
        "transactionDetail" : {
          "type" : "string",
          "maxLength" : 100,
          "description" : "Longer description of the transaction e.g. may contain additional error detail"
        }
      },
      "required" : [ "detailSequence", "hierarchyEntity", "transactionType" ]
    },
    "HierarchyEntity" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "accountId" : {
          "type" : "integer",
          "description" : "The account number that the payment/refund relates to"
        }
      }
    }
  }
}